package com.yanqu.road.entity.activity.washe.data;

public class WasheRmbMallData {

    private int mallId;
    private long beginTime;
    private int times;                      // 目前最多一次
    private int failTimes;

    // ----------------------------

    public boolean inCd(long cdTime) {
        if (beginTime > 0) {
            if (beginTime + cdTime > System.currentTimeMillis()) {
                return true;
            }
        }
        return false;
    }

    public boolean canBuy(long expireTime) {
        if (times <= 0 || beginTime <= 0) {
            return false;
        }
        if (beginTime + expireTime < System.currentTimeMillis()) {
            return false;
        }
        return true;
    }

    public void reset() {
        beginTime = 0;
        times = 0;
        failTimes = 0;
    }

    // ----------------------------


    public int getFailTimes() {
        return failTimes;
    }

    public void setFailTimes(int failTimes) {
        this.failTimes = failTimes;
    }

    public int getMallId() {
        return mallId;
    }

    public void setMallId(int mallId) {
        this.mallId = mallId;
    }

    public long getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(long beginTime) {
        this.beginTime = beginTime;
    }

    public int getTimes() {
        return times;
    }

    public void setTimes(int times) {
        this.times = times;
    }
}
